package at.ttasat;

public class Averager {
	private double sum = 0;
	private int nValues = 0;

	public void addValue(double value) {
		sum += value;
		nValues++;
	}

	public double getAverage() {
		if (nValues == 0) {
			return 0;
		}
		return sum / nValues;
	}
	
	public double getSum() {
		return sum ;
	}
	
	public int getNumberOfValues(){
		return nValues;
	}
}
